unmagic quotes
November 25, 2009 · 67 views · 0 comments
Nearby In Time
PDO thinks integers are strings
November 23, 2009
Pagination Workaround
November 23, 2009
Web Interface via jQuery
November 24, 2009
jQuery with Flexigrid
November 24, 2009
unmagic quotes
November 25, 2009
Hooking into events
November 27, 2009
White Marsh
November 27, 2009
In the attic
November 28, 2009
Inventory Server UI
November 28, 2009
About
I ran into a problem today with encoding strings for SQL. Upon looking into the problem, I realized an oddity from a past problem was very much related. It turns out that PHP, by default, escapes quotes. It was originally included with PHP to prevent SQL injection attacks. The problem however, is that like-minded developers who already take measures against this end up having data appear in the database as if someone had double- escaped the strings during an insert/update. I'm at a cross roads determining if I should detect if this is on, or to turn it off and assume that it will always be off. From Dedric Mauriac via bloghud.com